define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'nearby_list/index',
        add_url: 'nearby_list/add',
        edit_url: 'nearby_list/edit',
        delete_url: 'nearby_list/delete',
        export_url: 'nearby_list/export',
        modify_url: 'nearby_list/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {field: 'category_sort_1', title: '排序',edit:true},
                    {field: 'company_name', title: '公司名称'},
                    {field: 'position_name', title: '职位名称'},
                    {field: 'recruitment_area', title: '招聘区域', search: false},
                    {field: 'category_name', title: '所属分类'},
                    {field: 'expected_num', title: '最大报名人数', search: false},
                    {field: 'recruit_num', title: '报名人数', search: false},
                    {field: 'cur_status', minWidth: 80, title: '岗位状态',selectList: {1: '已上架',2: '已下架',3: '待审核',4: '审核驳回'}},
                    {field: 'is_recommended', minWidth: 80, title: '推荐状态',selectList: {0: '否',1: '是'}},
             
                    {field: 'created_at', title: '发布时间', search: false},
                    {title: '操作', width:250,templet: function (d) {
                            return '<button class="layui-btn layui-btn-xs layui-btn-blue" data-open="registration_list/index?id='+d.id+'" data-full="true" data-title="报名列表">报名列表</button>';
                        }
                    }, 

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});